import java.util.Scanner;
import java.util.Stack;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        Stack<Character> stack=new Stack<>();
        Stack<Character> stack1=new Stack<>();
        int i=1;
        stack.push(str.charAt(0));
        while(i<str.length()){
            if(stack.isEmpty()) {
                stack.push(str.charAt(i));
            }else if(stack.peek()==str.charAt(i)){
                stack.pop();
            }else{
                stack.push(str.charAt(i));
            }
            i++;
        }
        while(!stack.isEmpty()){
            stack1.push(stack.pop());
        }
        while(!stack1.isEmpty()){
            System.out.print(stack1.pop());
        }
    }
    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        int m=sc.nextInt();
        int n=sc.nextInt();
        int count=0;
        for(int i=m;i<=n;i++){
            String str=String.valueOf(i);
            for(int j=0;j<str.length();j++){
                if(str.charAt(j)=='2'){
                    count++;
                }
            }
        }
        System.out.println(count);
    }

}